#include "algorithm.h"

// leetcode solution NO.26: filter out repeated number from array, return counts of removed elements
int __leetcode_solution__ find_repeated_number(int *array, int len)
{
    int new_array_index = 1;
    for (int index = 1; index < len; index++)
    {
        if (array[index - 1] != array[index])
        {
            array[new_array_index] = array[index];
            new_array_index++;
        }
    }

    return new_array_index;
}